package com.ilop.sthome.data.bean;

import java.util.List;

/**
 * @author skygge
 * @date 2020-01-10.
 * GitHub：javofxu@github.com
 * email：skygge@yeah.net
 * description：
 */
public class DeviceHistoryBean implements Comparable<DeviceHistoryBean>{

    private int day;

    private int month;

    private int year;

    private String daytime;

    private int number;

    private List<WarnBean> list;

    private List<HistoryBean> subList;

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public String getDaytime() {
        return daytime;
    }

    public void setDaytime(String daytime) {
        this.daytime = daytime;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public List<WarnBean> getList() {
        return list;
    }

    public void setList(List<WarnBean> list) {
        this.list = list;
    }

    public List<HistoryBean> getSubList() {
        return subList;
    }

    public void setSubList(List<HistoryBean> subList) {
        this.subList = subList;
    }

    @Override
    public int compareTo(DeviceHistoryBean o) {
        int i = this.year - o.year; //先按年份排序
        if (i == 0){
            int k = this.month - o.month; // 如果年份相等了再按照月份排序
            if (k == 0){
                return this.day - o.day; //如果月份相等 再按照日期排序
            }else {
                return k;
            }
        }
        return i;
    }

}
